<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../include.jsp"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>后台管理-管理员登录</title>
    <link rel="stylesheet" href="${ctx}/static/admin/css/pintuer.css"/>
 	<link rel="stylesheet" href="${ctx}/static/admin/css/admin.css"/>
    
    <script src="${ctx }/static/lib/jquery-1.11.1.min.js"></script>
    <script src="${ctx }/static/lib/xhzutils.js"></script>
    <script src="${ctx }/static/admin/jquery-validate/jquery.validate.min.js"></script>
    <link type="image/x-icon" href="${ctx }/favicon.ico" rel="shortcut icon" />
    <link href="${ctx }/favicon.ico" rel="bookmark icon" />
	
	<script type="text/javascript">
		
		$(function(){
			
			$('#btnLogin').on('click',function(){
				$('.shake-hover').hide() ;
				
				var userinfo = {
					password: $('#password').val() ,
					username: $('#username').val()
				} ;
				XHZ.post('${ctx }/doAjaxLogin',userinfo,function(data){
					var info = data.message ;
					if(!data.code){
						$('.shake-hover').val(info) ;
						$('.shake-hover').show() ;
					//	alert(info) ;
						return  ;
					}
					
					window.location.href = '${ctx}/admin';
				});
				
			});
			
		});
	</script>
</head>

<body>
<div class="container">
    <div class="line">
        <div class="xs6 xm4 xs3-move xm4-move">
            <br /><br />
            <div class="media media-y">
            </div>
            <br /><br />
            <form action="" method="post" id="frmLogin">
	            <div class="panel">
	                <div class="panel-head">
	                	<strong>销售管理系统</strong>
	                	<button style="display: none;" class="button bg-red shake-hover ">用户名或密码不正确.</button>
                	</div>
	                <div class="panel-body" style="padding:30px;">
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="text" class="input" name="username" id="username" placeholder="登录账号" data-validate="required:请填写账号,length#>=5:账号长度不符合要求" value='f888888'/>
	                            <span class="icon icon-user"></span>
	                        </div>
	                    </div>
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="password" class="input" name="password" id="password" placeholder="登录密码" data-validate="required:请填写密码,length#>=6:密码长度不符合要求" value="123456"/>
	                            <span class="icon icon-key"></span>
	                        </div>
	                    </div>
	                    <%-- 
	                    <div class="form-group">
	                        <div class="field">
	                            <input type="text" class="input"  name="captcha" id="randomCode" placeholder="填写右侧的验证码" data-validate="required:请填写右侧的验证码" />
	                            <img src="${ctx}/images/kaptcha.jpg" class="passcode" onClick="javascript:this.src+='?';" alt="看不清？点一下"/>
	                        </div>
	                    </div>
	                     --%>
	                </div>
	                
	                <div class="panel-foot text-center">
	                	<input class="button button-block bg-main text-big" id="btnLogin" type="button" value="立即登录后台" />
	                </div>
	                
	            </div>
            </form>
        </div>
    </div>
</div>
<button style="display: none" id="btn_alert" class="button button-big bg-main dialogs" data-toggle="click" data-target="#mydialog" data-mask="1" data-width="30%">弹出对话框</button>

<div id="mydialog">
  <div class="dialog">
    <div class="dialog-head">
      <span class="close rotate-hover"></span>
      <strong>警告</strong>
    </div>
    <div class="dialog-body" id="warning-dialog-body">
      	对话框内容
    </div>
    <div class="dialog-foot">
      <button class="button dialog-close">关闭</button>
    </div>
  </div>
</div>
</body>
</html>